package com.itheima.duotai.homework.homework6;

public class AnimalOperator {
   public void useAnimal(Animal a){
       Animal animal=a;
       a.drink();
       a.eat();
       if(a instanceof Dog){
          Dog dog=(Dog) a;
          dog.swim();
       }
       if (a instanceof Frog){
           Frog frog=(Frog) a;
           frog.swim();
       }
   }

}
